const express = require('express')

const app = express()

// app.use(express.json())

app.post('/user/add', (req, res) => {
  // 若没有定义请求表单的中间件，那么req.body的值为undefined
  console.log(req.body)
  res.send('user add success!')
})

app.use(express.urlencoded({ extended: false }))

app.post('/book/add', (req, res) => {
  console.log(req.body)
  res.send('book add success!')
})

app.listen(80, () => {
  console.log('express server running at http://127.0.0.1')
})

